*********************************************************************************
* Ergebnisse zum Abschnitt "Gruppenunterschiede" II								*
*********************************************************************************

* Project: 	Sonderheft ZfP
* Authors: 	Matthias Mader
* Date:		Jan 2025

* Data: secEUrity Project, IPSOS supplementary survey 2024

*********************************************************************************

*** Setup
	clear
	set more off            						// Disable partitioned output
	set dp period									// Use comma instead of dot for decimals
	set linesize 80         						// Line size limit to make output more readable
	macro drop _all         						// clear all macros
	set scheme burd, permanent						// set graph scheme, e.g., cleanplots, plottig, plotplainblind, burd3, s1mono
	graph set window fontface "Times New Roman"		// set font in graphs | "Arial" | "Times New Roman"


*** Open clean data set
	use DATA_clean, clear


*** Abbildung 4

	*Kachel 1: allgemeine Verteilung
	
	fre inter_d1 multi_d1 mili_d1

	gen posture1 = inter_d1
	gen posture2 = multi_d1
	gen posture3 = mili_d1

	gen posturex1 = inter_d1*-1 + 1
	gen posturex2 = multi_d1*-1 + 1
	gen posturex3 = mili_d1*-1 + 1

	
	keep posture1 posture2 posture3 posturex1 posturex2 posturex3
	gen id = _n 
	reshape long posture posturex, i(id) j(post_type) string 


	graph bar posturex posture posture, over(post_type, relabel(1 `" "Isolationisten (63%) /        " "        Internationalisten (37%)" "' 2 `" "Unilateralisten (36%) /        "  "        Multilateralisten (64%)" "' 3 `" "Tauben (61%) /     " "        Falken (39%)" "')) name(g1, replace) ///
		title("  {bf:Anteile insgesamt} ", span size(medlarge)) ///
		legend(off) ///
		yline(.1, lstyle(solid color(gs14))) ///
		yline(.2, lstyle(solid color(gs14))) ///
		yline(.3, lstyle(solid color(gs14))) ///
		yline(.4, lstyle(solid color(gs14))) ///
		yline(.5)  /// 
		yline(.6, lstyle(solid color(gs14))) ///
		yline(.7, lstyle(solid color(gs14))) ///
		yline(.8, lstyle(solid color(gs14))) ///
		ytitle("") yscale(range(0 .8) lstyle(none)) ylabel(0 "0%" .1 "10%" .2 "20%"  .3 "30%" .4 "40%" .5 "50%" .60 "60%" .70 "70%" .8 "80%")  ///
		graphregion(margin(0 0 0 5))


	
	*Kacheln 2-4: Grundhaltungen unter Parteianhängern
	use DATA_clean, clear	

	tab pi_vvshort inter_d1, nof row
	graph bar inter_d1, over(pi_vvshort) asyvars name(g2, replace) ///
		title("  {bf:Anteil Internationalisten}", span size(medlarge)) ///
		legend(off) ///
		yline(.1, lstyle(solid color(gs14))) ///
		yline(.2, lstyle(solid color(gs14))) ///
		yline(.3, lstyle(solid color(gs14))) ///
		yline(.4, lstyle(solid color(gs14))) ///
		yline(.5)  /// 
		yline(.6, lstyle(solid color(gs14))) ///
		yline(.7, lstyle(solid color(gs14))) ///
		yline(.8, lstyle(solid color(gs14))) ///
		ytitle("") yscale(lstyle(none)) ylabel(0 "0%" .1 "10%" .2 "20%"  .3 "30%" .4 "40%" .5 "50%" .60 "60%" .70 "70%" .8 "80%") ///
		bargap(50) ///
		bar(1, color(purple)) bar(2, color(green)) bar(3, color(red)) bar(4, color(yellow)) bar(5, color(black)) bar(6, color(blue)) bar(7, color(gs10)) ///
		text(-.05 7 "BSW", placement(north))			text(-.09 7 "(22%)", placement(north)) ///
		text(-.05 21.5 "Grüne", placement(north))		text(-.09 21.5 "(66%)", placement(north)) ///
		text(-.05 36 "SPD", placement(north))			text(-.09 36 "(45%)", placement(north)) ///
		text(-.05 50.5 "FDP", placement(north))			text(-.09 50.5 "(36%)", placement(north)) ///
		text(-.05 65 "CDU/CSU", placement(north))		text(-.09 65 "(39%)", placement(north)) ///
		text(-.05 79 "AfD", placement(north))			text(-.09 79.05 "(9%)", placement(north)) ///
		text(-.05 94 "Keine Partei", placement(north))	text(-.09 94 "(22%)", placement(north)) ///
		graphregion(margin(0 0 10 5))

	tab pi_vvshort multi_d1, nof row
	graph bar multi_d1, over(pi_vvshort) asyvars name(g3, replace) ///
		title("  {bf:Anteil Multilateralisten}", span size(medlarge)) ///
		legend(off) ///
		yline(.1, lstyle(solid color(gs14))) ///
		yline(.2, lstyle(solid color(gs14))) ///
		yline(.3, lstyle(solid color(gs14))) ///
		yline(.4, lstyle(solid color(gs14))) ///
		yline(.5)  /// 
		yline(.6, lstyle(solid color(gs14))) ///
		yline(.7, lstyle(solid color(gs14))) ///
		yline(.8, lstyle(solid color(gs14))) ///
		ytitle("") yscale(lstyle(none)) ylabel(0 "0%" .1 "10%" .2 "20%"  .3 "30%" .4 "40%" .5 "50%" .60 "60%" .70 "70%" .8 "80%") ///
		bargap(50) ///
		bar(1, color(purple)) bar(2, color(green)) bar(3, color(red)) bar(4, color(yellow)) bar(5, color(black)) bar(6, color(blue)) bar(7, color(gs10)) ///
		text(-.05 7 "BSW", placement(north))			text(-.09 7 "(53%)", placement(north)) ///
		text(-.05 21.5 "Grüne", placement(north))		text(-.09 21.5 "(79%)", placement(north)) ///
		text(-.05 36 "SPD", placement(north))			text(-.09 36 "(75%)", placement(north)) ///
		text(-.05 50.5 "FDP", placement(north))			text(-.09 50.5 "(72%)", placement(north)) ///
		text(-.05 65 "CDU/CSU", placement(north))		text(-.09 65 "(73%)", placement(north)) ///
		text(-.05 79 "AfD", placement(north))			text(-.09 79.05 "(48%)", placement(north)) ///
		text(-.05 94 "Keine Partei", placement(north))	text(-.09 94 "(50%)", placement(north)) ///
		graphregion(margin(0 0 10 5))

	tab pi_vvshort mili_d1, nof row
	graph bar mili_d1, over(pi_vvshort) asyvars name(g4, replace) ///
		title("  {bf:Anteil Falken}", span size(medlarge)) ///
		legend(off) ///
		yline(.1, lstyle(solid color(gs14))) ///
		yline(.2, lstyle(solid color(gs14))) ///
		yline(.3, lstyle(solid color(gs14))) ///
		yline(.4, lstyle(solid color(gs14))) ///
		yline(.5)  /// 
		yline(.6, lstyle(solid color(gs14))) ///
		yline(.7, lstyle(solid color(gs14))) ///
		yline(.8, lstyle(solid color(gs14))) ///
		ytitle("") yscale(lstyle(none)) ylabel(0 "0%" .1 "10%" .2 "20%"  .3 "30%" .4 "40%" .5 "50%" .60 "60%" .70 "70%" .8 "80%") ///
		bargap(50) ///
		bar(1, color(purple)) bar(2, color(green)) bar(3, color(red)) bar(4, color(yellow)) bar(5, color(black)) bar(6, color(blue)) bar(7, color(gs10)) ///
		text(-.05 7 "BSW", placement(north))			text(-.09 7 "(22%)", placement(north)) ///
		text(-.05 21.5 "Grüne", placement(north))		text(-.09 21.5 "(47%)", placement(north)) ///
		text(-.05 36 "SPD", placement(north))			text(-.09 36 "(44%)", placement(north)) ///
		text(-.05 50.5 "FDP", placement(north))			text(-.09 50.5 "(64%)", placement(north)) ///
		text(-.05 65 "CDU/CSU", placement(north))		text(-.09 65 "(51%)", placement(north)) ///
		text(-.05 79 "AfD", placement(north))			text(-.09 79.05 "(30%)", placement(north)) ///
		text(-.05 94 "Keine Partei", placement(north))	text(-.09 94 "(24%)", placement(north)) ///
		graphregion(margin(0 0 10 5 ))

	
	*Teilabbildungen  müssen händisch mit kombiniert werden.

